#!/usr/bin/env python3

def main():
    a = "99223"
    b = "789"
    r = []

    print("%s + %s = " % (a, b), end="")
    l = len(a) if len(a) > len(b) else len(b)
    ta = a[::-1].ljust(l, '0')
    tb = b[::-1].ljust(l, '0')

    for i in range(l):
        n = r.pop() if r else 0
        n += (ord(ta[i]) - 48) + (ord(tb[i]) - 48)
        r.extend([n % 10, n // 10])

    r.reverse()
    print(''.join([chr(x + 48) for x in r]))

if __name__ == "__main__":
    main()
